package com.java.grammer; /**
 *
 */

/**
 * @Description
 * @author xiaoqi   Email:1404899001@qq.com
 * @version
 * @date 2020-11-1420:24:01
 * 奇数偶数
 */
public class ForTest_5_oddities {
    public static void main(String args[]) {
        int sum = 0;
        int jishu = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 2 == 0) {
                sum += i;
            } else {
                jishu += i;
            }
        }
        System.out.println("偶数和为" + sum);
        System.out.println("奇数和为" + jishu);

    }
}
